﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using LGE;
using Microsoft.Xna.Framework;

namespace YouOnlyGetOne
{
    class ArrowTrap : GameObject
    {
        int interval = 2000;
        double timer = 0;
        new Vector2 direction;

        public ArrowTrap(PlayScreen ps, Vector2 pos, Vector2 direction)
            : base(ps, null)
        {
            this.position = pos;
            this.direction = direction;
            position += direction * 33;
            interval += Rand.Next(1000);
        }

        public override void Update(GameTime gameTime)
        {
            timer += gameTime.ElapsedGameTime.TotalMilliseconds;
            if (timer > interval)
            {
                timer = 0;
                ps.GameObjects.Add(new Arrow(ps, position, direction));
                //Audio.PlayCue("arrow_shoot");
            }
        }

        public override void Draw(SpriteBatch spriteBatch)
        {
        }
    }
}
